package com.web.controller;

import com.alibaba.cloud.sentinel.datasource.converter.JsonConverter;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalTime;

@RestController
public class HelloController {

    private final JsonConverter converter;

    public HelloController(@Qualifier("sentinel-json-system-converter") JsonConverter converter) {
        this.converter = converter;
    }

    @RequestMapping("/hello")
    public String hello(){
        return "hello sentinel!!";
    }

    @RestController
    public class OrderController {

        @GetMapping("/order")
        public String order(){
            System.out.println(Thread.currentThread().getName()+"等待"+ System.currentTimeMillis());
            return "这是订单接口!";
        }

        @GetMapping("/payment")
        public String payment(){
            return "这是支付接口!";
        }
    }
}